<?php
namespace app\restaurant\model;

use app\BaseModel;
use think\facade\Db;

class FeedingCar extends BaseModel
{
    //定义表名
    protected $name = 'longbing_card_restaurant_feeding_card';



    /**
     * @author chenniang
     * @DataTime: 2020-09-29 11:04
     * @功能说明:添加
     */
    public function dataAdd($data,$goods_id,$uniacid){

        $this->where(['goods_id'=>$goods_id])->delete();

        if(!empty($data)){

            foreach ($data as $k=>$v){

                if(!empty($data[$k]['id'])){

                    unset($data[$k]['id']);
                }

                $data[$k]['uniacid'] = $uniacid;

                $data[$k]['goods_id'] = $goods_id;

            }
             $res = $this->saveAll($data);
        }

        return true;

    }















}